home *** CD-ROM | disk | FTP | other *** search
- <refentry id="libgimp-gimpmath" revision="19 Jan 2001">
- <refmeta>
- <refentrytitle>gimpmath</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>LIBGIMP Library</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>gimpmath</refname><refpurpose>Mathematical definitions and macros.</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv><title>Synopsis</title>
- <synopsis>
-
-
-
- #define <link linkend="FINITE-CAPS">FINITE</link> (x)
- #define <link linkend="G-PI-CAPS">G_PI</link>
- #define <link linkend="G-PI-2-CAPS">G_PI_2</link>
- #define <link linkend="G-PI-4-CAPS">G_PI_4</link>
- #define <link linkend="G-SQRT2-CAPS">G_SQRT2</link>
- #define <link linkend="G-MAXRAND-CAPS">G_MAXRAND</link>
- #define <link linkend="RINT-CAPS">RINT</link> (x)
- #define <link linkend="ROUND-CAPS">ROUND</link> (x)
- #define <link linkend="SQR-CAPS">SQR</link> (x)
- #define <link linkend="MAX255-CAPS">MAX255</link> (a)
- #define <link linkend="CLAMP0255-CAPS">CLAMP0255</link> (a)
- #define <link linkend="gimp-deg-to-rad">gimp_deg_to_rad</link> (angle)
- #define <link linkend="gimp-rad-to-deg">gimp_rad_to_deg</link> (angle)
- </synopsis>
- </refsynopsisdiv>
-
-
-
-
-
- <refsect1>
- <title>Description</title>
- <para>
- Mathematical definitions and macros.
-
- </para>
- </refsect1>
-
- <refsect1>
- <title>Details</title>
- <refsect2>
- <title><anchor id="FINITE-CAPS">FINITE()</title>
- <programlisting>#define FINITE(x)</programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="G-PI-CAPS">G_PI</title>
- <programlisting>#define G_PI 3.14159265358979323846
- </programlisting>
- <para>
-
- </para></refsect2>
- <refsect2>
- <title><anchor id="G-PI-2-CAPS">G_PI_2</title>
- <programlisting>#define G_PI_2 1.57079632679489661923
- </programlisting>
- <para>
-
- </para></refsect2>
- <refsect2>
- <title><anchor id="G-PI-4-CAPS">G_PI_4</title>
- <programlisting>#define G_PI_4 0.78539816339744830962
- </programlisting>
- <para>
-
- </para></refsect2>
- <refsect2>
- <title><anchor id="G-SQRT2-CAPS">G_SQRT2</title>
- <programlisting>#define G_SQRT2 1.4142135623730951
- </programlisting>
- <para>
-
- </para></refsect2>
- <refsect2>
- <title><anchor id="G-MAXRAND-CAPS">G_MAXRAND</title>
- <programlisting>#define G_MAXRAND</programlisting>
- <para>
-
- </para></refsect2>
- <refsect2>
- <title><anchor id="RINT-CAPS">RINT()</title>
- <programlisting>#define RINT(x)</programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="ROUND-CAPS">ROUND()</title>
- <programlisting>#define ROUND(x) ((int) ((x) + 0.5))
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="SQR-CAPS">SQR()</title>
- <programlisting>#define SQR(x) ((x) * (x))
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="MAX255-CAPS">MAX255()</title>
- <programlisting>#define MAX255(a) ((a) | (((a) & 256) - (((a) & 256) >> 8)))
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>a</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="CLAMP0255-CAPS">CLAMP0255()</title>
- <programlisting>#define CLAMP0255(a) CLAMP(a,0,255)
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>a</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-deg-to-rad">gimp_deg_to_rad()</title>
- <programlisting>#define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0)
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>angle</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-rad-to-deg">gimp_rad_to_deg()</title>
- <programlisting>#define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))
- </programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>angle</parameter> :</entry>
- <entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
-
- </refsect1>
-
-
-
-
- </refentry>
-